<template>

  <!--  <div>-->
  <!--    关键字： <el-input v-model="form.quan" placeholder="请输入手机号/ID"></el-input>-->
  <!--  </div>-->
  <!--  关键字： <el-input v-model="form.quan" placeholder="请输入手机号/ID"></el-input>&ndash;&gt;-->
  <el-container class="home-container">
    <el-header><!-- 头部区 -->
      <div>
        <span>智能快递柜后台管理系统</span>
      </div>
      <el-menu
          :default-active="activeIndex"
          class="el-menu-demo"
          mode="horizontal"
          @select="handleSelect"
          background-color="#545c64"
          text-color="#fff"
          active-text-color="#ffd04b"
          id="indexMenu">
        <el-menu-item index="1" @click="shouye">首页</el-menu-item>
        <el-menu-item index="2" @click="huiyuan">会员</el-menu-item>
        <el-menu-item index="3" @click="goToMachine">柜机</el-menu-item>
        <el-menu-item index="4" @click="baoguo">包裹</el-menu-item>
        <el-menu-item index="5" @click="caiwu">财务</el-menu-item>
        <el-menu-item index="6" @click="other">其他</el-menu-item>
      </el-menu>
    </el-header>
    <!-- 页面主体区域 -->
    <el-container>
      <!-- 侧边栏 -->
      <el-aside width="210px" hight="100%">
        <el-menu
            class="el-menu-vertical-demo"
            background-color="#545c64"
            text-color="#fff"
            active-text-color="#ffd04b">
          <el-submenu index="1">
            <template slot="title">
              <i class="el-icon-location"></i>
              <span>财务管理</span>
            </template>
            <el-menu-item-group>
              <!--              <template slot="title">分组一</template>-->
              <el-menu-item index="1-1" @click="zhanghu">账户信息</el-menu-item>
              <el-menu-item index="1-2">支付记录</el-menu-item>
              <el-menu-item index="1-3">充值记录</el-menu-item>
              <el-menu-item index="1-4">汇率管理</el-menu-item>

              <!--              <el-menu-item index="1-2">选项2</el-menu-item>-->
            </el-menu-item-group>

          </el-submenu>
          <el-menu-item index="2">
            <i class="el-icon-menu"></i>
            <span slot="title">导航二</span>
          </el-menu-item>
          <el-menu-item index="4">
            <i class="el-icon-setting"></i>
            <span slot="title">导航四</span>
          </el-menu-item>
        </el-menu>
      </el-aside>
      <!-- 右侧内容主体 -->
      <el-main>
        <!--<span>aaa</span>-->
        <div style="float: left">
          <span style="color: #545c64 ; font-size: 12px">其他管理/意见反馈/反馈详情</span>
        </div>
        <br><br>


        <div style="background-color: white;width: 100%;height: 2000px">

          <div style="border-bottom: #181818;width: 200px;">
            <span style="float: left;font-weight: bold;margin-left: 10px;margin-top: 10px">反馈详情</span><br><br>
          </div>
          <hr width="100%"><br><br>
          <div style="float: right;margin-right: 20px" @click="fanhui">返回</div><br><br>

          <div style="width: 800px; height: 100%" v-if="this.payment.processingStatus==1">
          <div style="border: #181818;background-color: #409EFF;float: left;margin-left: 50px">
            <p>反馈人------------------------</p>
            <p>手机号码--------------------</p>
            <p>来源----------------------</p>
            <p>处理状态---------------</p>
            <p>问题类型-----------------</p>
            <div style="height: 200px">
              <p>反馈内容---------------</p>
            </div>
            <p>联系方式---------------------</p>

            <p>反馈时间-------------------</p>

            <p>是否需要跟进------------------</p>
            <p>回复内容-----------------------</p>

          </div>
          <div style="border: #181818;float: right;margin-right: 0px;background-color: antiquewhite">
            <p>{{ this.payment.feedbackPerson }}</p>
            <p>{{ this.payment.phone }}</p>
            <p>{{ this.payment.source }}</p>
            <p>{{ this.payment.processingStatus==1?'未跟进':this.payment.processingStatus==2?'跟进中':'已完结' }}</p>
            <p>{{ this.payment.questionType==1?'账号问题':'网络问题' }}</p>
            <div style="width: 500px; background-color: white;height: 210px; margin-top: 30px">
              <p>{{ this.payment.feedbackContent }}</p>
              <div v-for="(imageUrl, index) in this.shuzu" :key="index" style="float: left">
                <img :src="imageUrl" width="60" height="60" />&nbsp;&nbsp;&nbsp;

              </div>

            </div>

            <p>{{ this.payment.phone }}</p>
            <p> {{this.payment.feebackTime|format('yyyy-MM-dd hh:mm:ss')}}</p>

            <div>


              <p>
                <el-form ref="payment" :model="payment" :rules="rules" label-width="80px">
                                    <el-radio-group v-model="payment.genjin">
                                      <el-radio :label="1">继续跟进</el-radio>
                                      <el-radio :label="2">反馈完结</el-radio>
                                    </el-radio-group>
                                  </el-form>
              </p>

            </div>
            <p>
              <el-form ref="payment" :model="payment" :rules="rules" label-width="80px">
                <input type="text" v-model="payment.huiContent" style="width: 500px;height: 200px"><br>
                <input type="text" v-model="this.payment.id" style="width: 500px;height: 200px">
              </el-form>

            </p>
            <p>
              <el-button type="primary" @click="update()">确 定</el-button>
              <el-button @click="dialogVisible = false">取 消</el-button>

            </p>
          </div>
          </div>


          <div style="width: 800px; height: 100%" v-if="this.payment.processingStatus==2">
            <div style="border: #181818;background-color: #409EFF;float: left;margin-left: 50px">
              <p>反馈人------------------------</p>
              <p>手机号码--------------------</p>
              <p>来源----------------------</p>
              <p>处理状态---------------</p>
              <p>问题类型-----------------</p>
              <div style="height: 200px">
                <p>反馈内容---------------</p>
              </div>
              <p>联系方式---------------------</p>
              <p>反馈时间--------------------</p>
              <p>回复内容-------------------</p>
              <p>回复时间-------------------</p>
              <div style="height: 200px">
                <p>补充反馈---------------------</p>
              </div>

              <p>补充时间-----------------------</p>
              <p>是否需要跟进------------------</p>
              <p>回复内容-----------------------</p>

            </div>
            <div style="border: #181818;float: right;margin-right: 0px;background-color: antiquewhite">
              <p>{{ this.payment.feedbackPerson }}</p>
              <p>{{ this.payment.phone }}</p>
              <p>{{ this.payment.source }}</p>
              <p style=" font-weight: bold;font-size: large ">{{ this.payment.processingStatus==1?'未跟进':this.payment.processingStatus==2?'跟进中':'已完结' }}</p>
              <p>{{ this.payment.questionType==1?'账号问题':'网络问题' }}</p>
              <div style="width: 500px; background-color: white;height: 210px; margin-top: 30px">
                <p>{{ this.payment.feedbackContent }}</p>
                <div v-for="(imageUrl, index) in this.shuzu" :key="index" style="float: left">
                  <img :src="imageUrl" width="60" height="60" />&nbsp;&nbsp;&nbsp;

                </div>

              </div>

              <p>{{ this.payment.phone }}</p>
              <p> {{this.payment.feebackTime|format('yyyy-MM-dd hh:mm:ss')}}</p>
              <p>{{ this.payment.huiContent }}</p>
              <p>{{this.payment.feebackTime|format('yyyy-MM-dd hh:mm:ss')}}</p>
              <div style="height: 230px">
                <p>{{ this.fanbuchong.content }}</p>
                <div v-for="(imageUrl, index) in this.images" :key="index" style="float: left">
                  <img :src="imageUrl" width="60" height="60" />&nbsp;&nbsp;&nbsp;

                </div>
              </div>

              <p>{{this.payment.feebackTime|format('yyyy-MM-dd hh:mm:ss')}}</p>
              <div>


                <p>
                  <el-form ref="payment" :model="payment" :rules="rules" label-width="80px">
                    <el-radio-group v-model="payment.genjin">
                      <el-radio :label="1">继续跟进</el-radio>
                      <el-radio :label="2">反馈完结</el-radio>
                    </el-radio-group>
                  </el-form>
                </p>

              </div>
              <p>
                <el-form ref="payment" :model="payment" :rules="rules" label-width="80px">
                  <input type="text" v-model="payment.huiContent" style="width: 500px;height: 200px"><br>
                  <input type="text" v-model="this.payment.id" style="width: 500px;height: 200px">
                </el-form>

              </p>
              <p>
                <el-button type="primary" @click="update2()">确 定</el-button>
                <el-button @click="dialogVisible = false">取 消</el-button>

              </p>
            </div>
          </div>



          <div style="width: 800px; height: 100%" v-if="this.payment.processingStatus==3">
<!--            aaaaaa-->
            <div style="border: #181818;background-color: #409EFF;float: left;margin-left: 50px">
              <p>反馈人------------------------</p>
              <p>手机号码--------------------</p>
              <p>来源----------------------</p>
              <p>处理状态---------------</p>
              <p>问题类型-----------------</p>
              <div style="height: 200px">
                <p>反馈内容---------------</p>
              </div>
              <p>联系方式---------------------</p>
              <p>反馈时间--------------------</p>
              <p>回复内容-------------------</p>
              <p>回复时间-------------------</p>
              <div style="height: 200px">
                <p>补充反馈---------------------</p>
              </div>

              <p>补充时间-----------------------</p>

            </div>
            <div style="border: #181818;float: right;margin-right: 0px;background-color: antiquewhite">
              <p>{{ this.payment.feedbackPerson }}</p>
              <p>{{ this.payment.phone }}</p>
              <p>{{ this.payment.source }}</p>
              <p style=" font-weight: bold;font-size: large ">{{ this.payment.processingStatus==1?'未跟进':this.payment.processingStatus==2?'跟进中':'已完结' }}</p>
              <p>{{ this.payment.questionType==1?'账号问题':'网络问题' }}</p>
              <div style="width: 500px; background-color: white;height: 210px; margin-top: 30px">
                <p>{{ this.payment.feedbackContent }}</p>
                <div v-for="(imageUrl, index) in this.shuzu" :key="index" style="float: left">
                  <img :src="imageUrl" width="60" height="60" />&nbsp;&nbsp;&nbsp;

                </div>

              </div>

              <p>{{ this.payment.phone }}</p>
              <p> {{this.payment.feebackTime|format('yyyy-MM-dd hh:mm:ss')}}</p>
              <p>{{ this.payment.huiContent }}</p>
              <p>{{this.payment.feebackTime|format('yyyy-MM-dd hh:mm:ss')}}</p>
              <div style="height: 200px">
                <p>{{ this.fanbuchong.content }}</p>
                <div v-for="(imageUrl, index) in this.images" :key="index" style="float: left">
                  <img :src="imageUrl" width="60" height="60" />&nbsp;&nbsp;&nbsp;

                </div>
              </div>

              <p v-if="this.fanbuchong.content!=null && this.fanbuchong.content!=''">{{ this.payment.feebackTime|format('yyyy-MM-dd hh:mm:ss') }}</p>
              <div style="height: 60px">


              </div>

            </div>
          </div>



        </div>




      </el-main>
    </el-container>
  </el-container>
</template>

<script>
// import index from "vue-lazyload";
import axios from "axios";

export default {
  filters:{
    format(value,arg){
      function dateFormat(date, format) {
        if (typeof date === "string") {
          var mts = date.match(/(\/Date\((\d+)\)\/)/);
          if (mts && mts.length >= 3) {
            date = parseInt(mts[2]);
          }
        }
        date = new Date(date);
        if (!date || date.toUTCString() == "Invalid Date") {
          return "";
        }
        var map = {
          "M": date.getMonth() + 1, //月份
          "d": date.getDate(), //日
          "h": date.getHours(), //小时
          "m": date.getMinutes(), //分
          "s": date.getSeconds(), //秒
          "q": Math.floor((date.getMonth() + 3) / 3), //季度
          "S": date.getMilliseconds() //毫秒
        };
        format = format.replace(/([yMdhmsqS])+/g, function (all, t) {
          var v = map[t];
          if (v !== undefined) {
            if (all.length > 1) {
              v = '0' + v;
              v = v.substr(v.length - 2);
            }
            return v;
          } else if (t === 'y') {
            return (date.getFullYear() + '').substr(4 - all.length);
          }
          return all;
        });
        return format;
      }

      return dateFormat(value,arg);

    }
  },
  data() {
    return {
      activeIndex: '6',
      tableData: [{
      }],
      guiList: [{}],
      pageNumber: 0,
      pageSize: 2,
      total: 0,
      multipleSelection: [],
      form:{
        id:'',
      },
      dialogVisible:false,
      dialogVisible2:false,
      idd:'',
      phone:'',
      status:'',
      payment:{
        id:'',
        questionType:'',
        feedbackContent:'',
        feedbackPerson:'',
        source:'',
        feebackTime:'',
        processingTime:'',
        processingStatus:'',
        phone:'',
        genjin:'',
        huiContent:'',
        imgs:'',
        registerIp:'',
      },
      huobi:[{}],
      shuzu:[],
      sum:1,
      tupian:[],
      form2:{
        id:'',
      },
      radio: '1',
      fanbuchong:{},
      images:[],
      // table:{
      //   zbianhao:'',
      //   zname:'',
      //   fh:'',
      //   zdje:'',
      //   times:'',
      //   jsstatus:''
      // },

    };
  },
  methods: {
    other(){
      this.$router.push(
          {path: "/otherView"}
      )
    },
    baoguo(){
      this.$router.push(
          {path: "/OutPackage"}
      )
    },
    huiyuan(){
      this.$router.push(
          {path: "/expressList"}
      )
    },
    shouye(){
      this.$router.push({
        path:'/'
      })
    },

    caiwu(){
      this.$router.push({
        path:'/zhanghuPage'
      })
    },

    update2(){
      console.log("create================")
      axios.post('http://localhost:8878/feeback/updateExpressFeeback2',this.payment).then(res => {
        console.log("8888888888888888888"+this.payment.id)
        console.log("7777777777777"+this.payment.huiContent)
        console.log("7777777777777"+this.payment.genjin)
        console.log(res.data)
        if(res.data == '1'){
          this.$message({
            message: '操作成功',
            type: 'success'
          });
          this.dialogVisible=false;
          this.init()
        }
        else{
          this.$message.error('操作失败');
          this.init()
        }
      })
    },
    update(){
      console.log("create================")
      axios.post('http://localhost:8878/feeback/updateExpressFeeback',this.payment).then(res => {
        console.log("8888888888888888888"+this.payment.id)
        console.log("7777777777777"+this.payment.huiContent)
        console.log("7777777777777"+this.payment.genjin)
        console.log(res.data)
        if(res.data == '1'){
          this.$message({
            message: '操作成功',
            type: 'success'
          });
          this.dialogVisible=false;
          this.init()
        }
        else{
          this.$message.error('操作失败');
          this.init()
        }
      })


    },

    goToMachine(){
      this.$router.push(
          {path: "/machineHome"}
      )
    },
    fanhui(){
      this.$router.push({
        path:'/feebackPage'
      })
    },
    init(){
      axios.get('http://localhost:8878/feeback/findId?id='+this.$route.query.id).then(response=>{
        this.payment=response.data;
        this.shuzu=this.payment.imgs.split(",");

      })
    },
    buchong(){
      axios.get('http://localhost:8878/feeback/findExpressFeedbackSupplementId?fid='+this.$route.query.id).then(response=>{
        this.fanbuchong=response.data;
        if (this.fanbuchong.imgs!=null && this.fanbuchong.imgs!=''){
          this.images=this.fanbuchong.imgs.split(",");
        }
      })
    },

  },
  created() {

    this.init();
    this.buchong();

  }
};
</script>

<style lang="less">
#app {
  margin-top: 0;
}

.responsive-width {
  width: 300px;
}
.home-container {
  height: 100%;
}

.el-header {
  background-color: #545c64;
  display: flex; //设置显示为flex布局
  justify-content: space-between; //设置为flex左右布局
  padding-left: 0; //左内边距为0（Logo贴左边）
  align-items: center; //元素上下居中（防止右边按钮贴上下边）
  color: #fff;
  font-size: 18px;

  > div {
    //内嵌的div样式
    display: flex;
    align-items: center; //Logo和文字上下居中
    span {
      width: 200px;
      margin-left: 10px; //文字左侧设置间距，防止与Logo紧贴
    }
  }
}

#indexMenu {
  width: 100%;
}

.el-menu {
  background-color: #545c64;
}

.el-aside {
  background-color: #545c64;
  scrollbar-width: none; /* firefox */
  -ms-overflow-style: none; /* IE 10+ */
  overflow-x: hidden;
  overflow-y: auto;
}

.el-main {
  background-color: #eaedf1;
}
</style>